<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title><!DOCTYPE html>
        <html>
        <head>
            <meta charset="utf-8">
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <title>活动管理</title>
            <link rel="shortcut icon" href="favicon.ico">
            <link href="__PUBLIC__/Theme1/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
            <link href="__PUBLIC__/Theme1/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
            <link href="__PUBLIC__/Theme1/css/plugins/iCheck/custom.css" rel="stylesheet">
            <link href="__PUBLIC__/Theme1/css/animate.min.css" rel="stylesheet">
            <link href="__PUBLIC__/Theme1/css/style.min.css?v=4.1.0" rel="stylesheet">

        </head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>活动管理
                        <small><a href="{:U('/Admin/Good/edit')}" style="margin-left: 15px; color: #06cbc4">添加活动</a>
                        </small>
                    </h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="form_basic.html#">
                            <i class="fa fa-wrench"></i>
                        </a>

                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>

                    <div class="ibox-content">

                        <form method="post" action="__CONTROLLER__/index" class="form-horizontal"
                              enctype="multipart/form-data">
                            <div class="form-group">
                                <button id="btn" class="btn btn-success" type="submit">搜索</button>
                                <div class="col-sm-4">
                                    <input type="text" class="form-control" value="{$keyword}" name="keyword"
                                           id="keyword" placeholder="请输入活动名称">
                                </div>
                                <div class="col-sm-2">
                                    <select class="form-control" required name="menu_id">
                                        <option value="-1">全部</option>
                                        <volist name="menu" id="vo">
                                            <option
                                            <if condition="$vo['id'] eq $menu_id">selected</if>
                                            value="{$vo['id']}">{$vo['name']}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                        </form>

                        <table class="table table-striped table-bordered table-hover dataTables-example">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>活动名称</th>
                                <th>活动分类</th>
                                <th>早教机构</th>
                                <th>任务数量</th>
                                <th>剩余数量</th>
                                <th>任务地址</th>
                                <th>奖励金币</th>
                                <th>是否上线</th>
                                <th>创建时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <volist name="result" id="result">
                                <tr>
                                    <td>{$result.id}</td>
                                    <td>{$result.name}</td>
                                    <td>{$result.menu_name}</td>
                                    <td>{$result.zjname}</td>
                                    <td>{$result.num}</td>
                                    <td>{$result.snum}</td>
                                    <td>{$result.dz}</td>
                                    <td>{$result.jl}</td>
                                    <td>
                                        <if condition="$result['is_online'] eq 1"><font
                                                color="aqua">{$result['online']}</font>
                                            <else/>
                                            <font color="red">{$result['online']}</font></if>
                                    </td>
                                    <td>{$result.time|date="Y-m-d H:i",###}</td>
                                    <td>
                                        <a href="{:U('Admin/Good/edit',array('id'=>$result['id']))}">
                                            <button class="btn btn-warning">编辑</button>
                                        </a>

                                        <a onclick="delGoods({$result['id']})"
                                           onclick="if(confirm('确定删除?')==false)return false;">
                                            <button class="btn btn-danger">删除</button>
                                        </a>
                                        <if condition="$result['recommend'] eq 1">
                                            <a onclick="recommend({$result['id']})">
                                                <button class="btn btn-warning">不推荐</button>
                                            </a>
                                            <else/>

                                            <a onclick="recommend({$result['id']})">
                                                <button class="btn btn-success">推荐</button>
                                            </a>
                                        </if>
                                    </td>
                                </tr>
                            </volist>
                            </tbody>
                        </table>
                        <div class="pagination" style="margin:0px;">
                            {$page}
                        </div>
                    </div>
                </div>
            </div>
        </div>


    </div>

    <script src="__PUBLIC__/Theme1/js/jquery.min.js?v=2.1.4"></script>
    <script src="__PUBLIC__/Theme1/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="__PUBLIC__/Theme1/js/content.min.js?v=1.0.0"></script>
    <script src="__PUBLIC__/Theme1/js/plugins/iCheck/icheck.min.js"></script>
    <script src="__PUBLIC__/layer/layer.js"></script>
    <script>
        $(document).ready(function () {
            $(".i-checks").iCheck({checkboxClass: "icheckbox_square-green", radioClass: "iradio_square-green",})
        });
        function delGoods(id) {
            layer.alert('确定要删除吗?', {
                skin: 'layui-layer-molv' //样式类名  自定义样式
                , closeBtn: 1    // 是否显示关闭按钮
                , anim: 1 //动画类型
                , btn: ['确认', '取消'] //按钮
                , icon: 6    // icon
                , yes: function () {
                    window.location.href = "__CONTROLLER__/delGood/id/" + id;
                }
                , btn2: function () {
                }
            });
        }
        //推荐
        function recommend(id) {
            window.location.href = "__CONTROLLER__/recommend/id/" + id;
        }

    </script>
</body>
</html>
</title>
</head>
<body>

</body>
</html>